<#--Created by IntelliJ IDEA.
User: Administrator
Date: 2017/12/7
Time: 12:40
To change this template use File | Settings | File Templates.-->

<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>客户需求</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
  <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
  <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js" charset="utf-8"></script>
  <script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
</head>

<body>
<div class="x-body">
  <form class="layui-form layui-form-pane"  Id="saveForm1" style="margin-left: 20px;">
    <div class="layui-form-item">
      <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
        <legend style="font-size:16px;">客户需求</legend>
      </fieldset>
    </div>
    <div class="layui-form-item">
      <label for="uname" class="layui-form-label">
        <span class="x-red">*</span>报价编号
      </label>
      <div class="layui-input-inline">
        <input type="text" id="orderNo" name="orderNo" lay-verify="orderNo"  autocomplete="off" class="layui-input">
      </div>
      <div class="layui-inline">
        <label for="Date" class="layui-form-label">
          <span class="x-red">*</span>日期
        </label>
        <div class="layui-input-inline">
          <div class="layui-input-inline">
        <input type="text"  id="addTime" name="addTime"  lay-verify="addTime"  placeholder="yyyy-MM-dd HH:mm:ss"
               autocomplete="off" class="layui-input">
          </div>
        </div>
    </div>
    <div class="layui-form-item">
    <div class="layui-inline">
      <label for="saleName" class="layui-form-label">
        <span class="x-red">*</span>销售
      </label>
      <div class="layui-input-inline">
        <input type="text" id="saleName" name="saleName" lay-verify="saleName"  autocomplete="off" class="layui-input">
      </div>
    </div>
      <div class="layui-inline">
        <label for="salePhone" class="layui-form-label">
          <span class="x-red">*</span>销售电话
        </label>
        <div class="layui-input-inline">
          <input type="text" id="salePhone" name="salePhone"  lay-verify="salePhone"
                 autocomplete="off" class="layui-input">
        </div>
      </div>
    </div>

      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="company" class="layui-form-label">
            <span class="x-red">*</span>公司
          </label>
          <div class="layui-input-inline">
            <input type="text"  id="company" name="company"  lay-verify="company"
                   autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="conpanyAdress" class="layui-form-label">
            <span class="x-red">*</span>公司地址
          </label>
          <div class="layui-input-inline">
            <input type="text" id="conpanyAdress" name="conpanyAdress" lay-verify="conpanyAdress"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="companyContact" class="layui-form-label">
            <span class="x-red">*</span>联系人
          </label>
          <div class="layui-input-inline">
            <input type="text" id="companyContact" name="companyContact"  lay-verify="companyContact"
                   autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="companyPhone" class="layui-form-label">
            <span class="x-red">*</span>联系电话
          </label>
          <div class="layui-input-inline">
            <input type="text"  id="companyPhone" name="companyPhone"  lay-verify="companyPhone"
                   autocomplete="off" class="layui-input">
          </div>
        </div>
      </div>

      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="deliveryDate" class="layui-form-label">
            <span class="x-red">*</span>交期
          </label>
          <div class="layui-input-inline">
            <input type="text" id="deliveryDate" name="deliveryDate" lay-verify="deliveryDate" placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="amount" class="layui-form-label">
            <span class="x-red">*</span>总金额
          </label>
          <div class="layui-input-inline">
            <input type="text" id="amount" name="amount"  lay-verify="amount"
                   autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="state" class="layui-form-label">
            <span class="x-red">*</span>状态
          </label>
          <div class="layui-input-inline">
            <input type="text"  id="state" name="state"  lay-verify="state"
                   autocomplete="off" class="layui-input">
          </div>
        </div>
      </div>
      <div class="layui-form-item">
        <label for="realName" class="layui-form-label" style="font: 20px;background-color: slategrey;width: 100%">
          <span class="x-red" style="font: 20px;background-color: slategrey;width: 100%"></span>打印
        </label>
      </div>
      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red">*</span>样件名称
          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotationSamples[0].sample"  value="${quotationSamples[0].sample}" lay-verify="quotationSamples[0].sample"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationSamples[0].orderNo"  value="${quotationSamples[0].orderNo}" lay-verify="quotationSamples[0].orderNo"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationSamples[0].id"  value="${quotationSamples[0].id}" lay-verify="quotationSamples[0].id"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>材料
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationSamples[0].material" value="${quotationSamples[0].material}" lay-verify="quotationSamples[0].material"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>数量
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationSamples[0].number" value="${quotationSamples[0].number}" lay-verify="quotationSamples[0].number"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>单价
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationSamples[0].price" value="${quotationSamples[0].price}" lay-verify="quotationSamples[0].price"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>

      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red"></span>样件名称
          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotationSamples[1].sample" defaultVal="无" value="${quotationSamples[1].sample}" lay-verify="quotationSamples[1].sample"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationSamples[1].orderNo"  value="${quotationSamples[1].orderNo}" lay-verify="quotationSamples[1].orderNo"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationSamples[1].id"  value="${quotationSamples[1].id}" lay-verify="quotationSamples[1].id"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red"></span>材料
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationSamples[1].material" defaultVal="无" value="${quotationSamples[1].material}" lay-verify="quotationSamples[1].material"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>数量
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationSamples[1].number" defaultVal="无" value="${quotationSamples[1].number}" lay-verify="quotationSamples[1].number"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>单价
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationSamples[1].price" defaultVal="无" value="${quotationSamples[1].price}" lay-verify="quotationSamples[1].price"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>

      <div class="layui-form-item">
      </div>
      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red">*</span>样件名称
            <input type="hidden"  name="quotationSamples[2].orderNo"  value="${quotationSamples[2].orderNo}" lay-verify="quotationSamples[0].orderNo"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationSamples[2].id"  value="${quotationSamples[2].id}" lay-verify="quotationSamples[0].id"  autocomplete="off" class="layui-input">

          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotationSamples[2].sample"  value="${quotationSamples[2].sample}" lay-verify="quotationSamples[2].sample"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>材料
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationSamples[2].material" value="${quotationSamples[2].material}" lay-verify="quotationSamples[2].material"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>数量
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationSamples[2].number" value="${quotationSamples[2].number}" lay-verify="quotationSamples[2].number"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>单价
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationSamples[2].price" value="${quotationSamples[2].price}" lay-verify="quotationSamples[2].price"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>

      <div class="layui-form-item">
        <label for="realName" class="layui-form-label" style="font: 20px;background-color: slategrey;width: 100%">
          <span class="x-red" style="font: 20px;background-color: slategrey;width: 100%">*</span>设计
        </label>
      </div>

      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red">*</span>设计类型
            <input type="hidden"  name="quotationDesigns[0].orderNo"  value="${quotationDesigns[0].orderNo}" lay-verify="quotationDesigns[0].orderNo"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationDesigns[0].id"  value="${quotationDesigns[0].id}" lay-verify="quotationDesigns[0].id"  autocomplete="off" class="layui-input">

          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotationDesigns[0].designType" value="${quotationDesigns[0].designType}" lay-verify="quotationDesigns[0].designType"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>数量
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationDesigns[0].number" value="${quotationDesigns[0].number}" lay-verify="quotationDesigns[0].number"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>小计
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationDesigns[0].subtotal" value="${quotationDesigns[0].subtotal}" lay-verify="quotationDesigns[0].subtotal"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>

      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red">*</span>设计类型
            <input type="hidden"  name="quotationDesigns[1].orderNo"  value="${quotationDesigns[1].orderNo}" lay-verify="quotationDesigns[0].orderNo"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationDesigns[1].id"  value="${quotationDesigns[1].id}" lay-verify="quotationDesigns[0].id"  autocomplete="off" class="layui-input">

          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotationDesigns[1].designType" value="${quotationDesigns[1].designType}" lay-verify="quotationDesigns[1].designType"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>数量
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationDesigns[1].number" value="${quotationDesigns[1].number}" lay-verify="quotationDesigns[1].number"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>小计
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationDesigns[1].subtotal" value="${quotationDesigns[1].subtotal}" lay-verify="quotationDesigns[1].subtotal"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>

      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red">*</span>设计类型
            <input type="hidden"  name="quotationDesigns[2].orderNo"  value="${quotationDesigns[2].orderNo}" lay-verify="quotationDesigns[0].orderNo"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationDesigns[2].id"  value="${quotationDesigns[2].id}" lay-verify="quotationDesigns[0].id"  autocomplete="off" class="layui-input">

          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotationDesigns[2].designType" value="${quotationDesigns[2].designType}" lay-verify="quotationDesigns[2].designType"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>数量
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationDesigns[2].number" value="${quotationDesigns[2].number}" lay-verify="quotationDesigns[2].number"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>小计
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationDesigns[2].subtotal" value="${quotationDesigns[2].subtotal}" lay-verify="quotationDesigns[2].subtotal"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>

      <div class="layui-form-item">
        <label for="realName" class="layui-form-label" style="font: 20px;background-color: slategrey;width: 100%">
          <span class="x-red" style="font: 20px;background-color: slategrey;width: 100%">*</span>后处理
        </label>
      </div>
      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red">*</span>样件名称
            <input type="hidden"  name="quotationHandles[0].orderNo"  value="${quotationHandles[0].orderNo}" lay-verify="quotationHandles[0].orderNo"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationHandles[0].id"  value="${quotationHandles[0].id}" lay-verify="quotationHandles[0].id"  autocomplete="off" class="layui-input">

          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotationHandles[0].sample" value="${quotationHandles[0].sample}" lay-verify="quotationHandles[0].sample"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>工艺
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationHandles[0].technology" value="${quotationHandles[0].technology}" lay-verify="quotationHandles[0].technology"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>小计
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationHandles[0].subtotal" value="${quotationHandles[0].subtotal}" lay-verify="quotationHandles[0].subtotal"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red">*</span>样件名称
            <input type="hidden"  name="quotationHandles[1].orderNo"  value="${quotationHandles[1].orderNo}" lay-verify="quotationHandles[1].orderNo"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationHandles[1].id"  value="${quotationHandles[1].id}" lay-verify="quotationHandles[1].id"  autocomplete="off" class="layui-input">

          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotationHandles[1].sample" value="${quotationHandles[1].sample}" lay-verify="quotationHandles[1].sample"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>工艺
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationHandles[1].technology" value="${quotationHandles[1].technology}" lay-verify="quotationHandles[1].technology"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>小计
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationHandles[1].subtotal" value="${quotationHandles[1].subtotal}" lay-verify="quotationHandles[1].subtotal"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red">*</span>样件名称
            <input type="hidden"  name="quotationHandles[2].orderNo"  value="${quotationHandles[2].orderNo}" lay-verify="quotationHandles[2].orderNo"  autocomplete="off" class="layui-input">
            <input type="hidden"  name="quotationHandles[2].id"  value="${quotationHandles[2].id}" lay-verify="quotationHandles[2].id"  autocomplete="off" class="layui-input">

          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotationHandles[2].sample" value="${quotationHandles[2].sample}" lay-verify="quotationHandles[2].sample"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>工艺
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationHandles[2].technology" value="${quotationHandles[2].technology}" lay-verify="quotationHandles[2].technology"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>小计
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotationHandles[2].subtotal" value="${quotationHandles[2].subtotal}" lay-verify="quotationHandles[2].subtotal"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>

      <div class="layui-form-item">
        <div class="layui-inline">
          <label for="realName" class="layui-form-label">
            <span class="x-red">*</span>设计合计
          </label>
          <div class="layui-input-inline">
            <input type="text"  name="quotation.designMoney" value="${quotation.designMoney}" lay-verify="quotation.designMoney"  autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>打印合计
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotation.sampleMoney" value="${quotation.sampleMoney}" lay-verify="quotation.sampleMoney"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-inline">
          <label for="age" class="layui-form-label">
            <span class="x-red">*</span>后处理合计
          </label>
          <div class="layui-input-inline">
            <div class="layui-input-inline">
              <input type="text"  name="quotation.handleMoney" value="${quotation.handleMoney}" lay-verify="quotation.handleMoney"  autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
      </div>
      <label for="realName" class="layui-form-label" style="font: 20px;background-color: slategrey;width: 100%">
        <span class="x-red" style="font: 20px;background-color: slategrey;width: 100%">*</span>table
      </label>
      <div class="layui-row layui-col-space5">

        <div>
          <span style="padding-right: 10px;font-size: 1.17em;margin-block-start: 1em;margin-block-end: 1em;margin-inline-start: 0px;margin-inline-end: 0px;">成本中心</span>
          <button class="layui-btn layui-btn-sm js_table_edit_customer_add">添加</button>
          <button class="layui-btn layui-btn-sm js_table_edit_customer_del">删除</button>
        </div>
        <div class="layui-form-item">
          <table class="layui-hide" id="js_table_goodsCustomers_edit_table"></table>
        </div>
      </div>
        <div class="layui-form-item" style="margin-bottom: 20px">

        <div class="layui-inline">
          <label for="L_repass" class="layui-form-label">
            <span class="x-red">*</span>税点
          </label>
          <div class="layui-input-inline">
            <input type="text" id="tax" name="tax" value="${quotation.tax}" lay-verify="amount"
                   autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label for="L_repass" class="layui-form-label">
            <span class="x-red">*</span>邮费
          </label>
          <div class="layui-input-inline">
            <input type="text" id="postage" name="postage" value="${quotation.postage}" lay-verify="amount"
                   autocomplete="off" class="layui-input">
          </div>
        </div>

        <div class="layui-inline">
          <label for="L_repass" class="layui-form-label">
            <span class="x-red">*</span>总金额
          </label>
          <div class="layui-input-inline">
            <input type="text" id="totalMoney" name="totalMoney" value="${quotation.totalMoney}" lay-verify="amount"
                   autocomplete="off" class="layui-input">
          </div>
        </div>
        <div style="height: 60px"></div>
      </div>

  <div style="width: 100%;height: 55px;background-color: white;border-top:1px solid #e6e6e6;
  position: fixed;bottom: 1px;margin-left:-20px;">
    <div class="layui-form-item" style=" float: right;margin-right: 30px;margin-top: 8px">

      <button  class="layui-btn layui-btn-normal" onclick="sub1()">
        增加
      </button>
      <button  class="layui-btn layui-btn-normal" class="layui-btn"  lay-filter="addtable" lay-submit>
        加一行
      </button>
      <button  class="layui-btn layui-btn-primary" id="close">
        取消
      </button>
    </div>
  </div>
  </form>
</div>
<script>
  var flag,msg;
  $(function(){
      $('#uname').on("blur",function(){
        var uname=$('#uname').val();
        if(uname.match(/[\u4e00-\u9fa5]/)){
          return;
        }
        if(!/(.+){3,12}$/.test(uname)){
          return;
        }
        if(uname!='') {
          $.ajax({
            url: 'checkUser?uname=' + uname, async: false, type: 'get', success: function (data) {
              console.info(!data.flag);
              flag = data.flag;
              $('#ms').find('span').remove();
              if (!data.flag) {
                msg = data.msg;
                $('#ms').append("<span style='color: red;'>"+data.msg+"</span>");
               // layer.msg(msg,{icon: 5,anim: 6});
              }else{
                flag=true;
                $('#ms').append("<span style='color: green;'>用户名可用</span>");
              }
            },beforeSend:function(){
              $('#ms').find('span').remove();
              $('#ms').append("<span>验证ing</span>");
            }
          });
        }
      });

  });
  function sub1() {
    var dataFrom = serializeRemoveNull($("#saveForm1").serialize());
    $.ajax({
      url: "addQuotation",
      type: "post",
      data:dataFrom,
      success: function (data) {
        window.top.layer.msg("保存成功", {icon: 6, offset: 'rb', area: ['120px', '80px'], anim: 2});
        window.parent.location.reload();//刷新父页面
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        parent.layer.close(index);
      },
      error: function () {
        alert("保存失败");
      }
    })
  }
  function serializeRemoveNull(serStr){
    return serStr.split("&").filter(str => !str.endsWith("=")).join("&");
  }
  layui.use(['form','layer','upload','laydate','table'], function(){
    $ = layui.jquery;
    var form = layui.form
        ,layer = layui.layer
            ,table = layui.table,
        upload = layui.upload, laydate = layui.laydate;
    laydate.render({
      elem: '#deliveryDate'
      ,trigger: 'click'
      // ,format: 'yyyy年MM月dd日'
      ,type: 'datetime'
    });
    laydate.render({
      elem: '#addTime'
      ,trigger: 'click'
      // ,format: 'yyyy年MM月dd日'
      ,type: 'datetime'
    });
    upload.render({
      elem: '#test10'
      ,url: 'upload'
      ,before: function(obj){
        //预读，不支持ie8
        obj.preview(function(index, file, result){
          $('#demo2').find('img').remove();
          $('#demo2').append('<img src="'+ result +'" alt="'+ file.name +'" width="100px" height="100px" class="layui-upload-img layui-circle">');
        });
      },done: function(res){
       if(!res.flag){
         layer.msg(res.msg,{icon: 5,anim: 6});
       }else{
         $("#photo").val(res.msg);
         console.info($('#photo').val());
       }
      }
    });
    table.render({
      elem: '#js_table_goodsCustomers_edit_table',
      data: [],
      even: true,
      method: 'POST',
      cols: [
        [
          {type: 'checkbox', width: 50},
          {field: 'orderNo', edit: "text", align: "center", title: '成本中心名称', width: "300"},
          {field: 'saleName', edit: "text", align: "center", title: '预算额度（按成本中心控制时有效）', width: "400"}
        ]]
    });
    var cbList = [];
    var layRowNum = 0;
    //添加成本中心
    $(".js_table_edit_customer_add").click(function () {
      var obj = {
        "orderNo": "",
        "saleName": ""
      };
      cbList = table.cache.js_table_goodsCustomers_edit_table;
      cbList.push(obj);
      layRowNum = layRowNum + 1;
      table.reload("js_table_goodsCustomers_edit_table", {
        data: cbList,
      })

    });
    var blankRowData = {
      'id': '', 'orderNo': '', 'saleName': ''
    };

    /*增加/删除一行点击事件*/
    table.on("toolbar(dataTableEditTable)", function (e) {
      switch (e.event) {
        case "add":
          tableData.push(blankRowData);
          table.reload('testadd', {
            data: tableData
          });
          break;
        case "del":
          tableData.splice(tableData.length -1 , 1);
          table.reload('testadd', {
            data: tableData
          });
          break;
      }
    });




    var d = new Date();
    var day=d.getFullYear()+"-"+(parseInt(d.getMonth())+1)+'-'+d.getDate();
    console.log(day);
    var $ = layui.$, active = {
      close: function () {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
      }
    }
    $('.layui-form-item .layui-btn').on('click', function () {
      var type = $(this).data('type');
      active[type] ? active[type].call(this) : '';
    });
    var a = laydate.render({
      elem: '#Date',
            trigger: 'click',
      min:day,
      done: function(value, date, endDate) {
        b.config.min = {
          year: date.year,
          month: date.month - 1,
          date: date.date,
          hours: date.hours,
          minutes: date.minutes,
          seconds: date.seconds
        }
      }
    });
    laydate.render({
      elem: '#date'
      ,trigger: 'click'
      ,type: 'datetime'
    });
    laydate.render({
      elem: '#deliveryDate'
      ,trigger: 'click'
      ,type: 'datetime'
    });

   $('#close').click(function(){
     var index = parent.layer.getFrameIndex(window.name);
     parent.layer.close(index);
   });
    form.on('submit(add)', function(data){
      var dataForms = serializeRemoveNull(data.field);
      $.ajax({
        url:'addQuotation',
        type:'post',
        dataType: "json",
        data:dataForms,
        async:false, traditional: true,
        success:function(d){
          var index = parent.layer.getFrameIndex(window.name);
          if(d.flag){
            parent.layer.close(index);
            window.parent.layui.table.reload('leaveList');
            window.top.layer.msg(d.msg,{icon:6,offset: 'rb',area:['120px','80px'],anim:2});
          }else{
            layer.msg(d.msg,{icon:5});
          }
        },error:function(){
          layer.alert("请求失败", {icon: 6},function () {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
          });
        }
      });
      return false;
    });
    table.on('submit(addtable)', function(data){
      tableData.push(blankRowData);
      table.reload('testadd', {
        data: tableData
      });
    });
    form.render();
  });
</script>
</body>

</html>
